import request from '@/utils/request'

// 查询我的故事列表
export function listStory(query) {
  return request({
    url: '/publish/story/list',
    method: 'get',
    params: query
  })
}

// 查询我的故事详细
export function getStory(id) {
  return request({
    url: '/publish/story/' + id,
    method: 'get'
  })
}

// 查询我自己的故事详细
export function getMyStory() {
  return request({
    url: '/publish/story/getMyStory',
    method: 'get'
  })
}

export function getUserStory(id) {
  return request({
    url: '/publish/story/getUserStory/' + id,
    method: 'get',
  })
}


// 保存我的故事
export function saveStory(data) {
  return request({
    url: '/publish/story/save',
    method: 'post',
    data: data
  })
}

// 新增我的故事
export function addStory(data) {
  return request({
    url: '/publish/story',
    method: 'post',
    data: data
  })
}

// 修改我的故事
export function updateStory(data) {
  return request({
    url: '/publish/story',
    method: 'put',
    data: data
  })
}

// 删除我的故事
export function delStory(id) {
  return request({
    url: '/publish/story/' + id,
    method: 'delete'
  })
}

// 导出我的故事
export function exportStory(query) {
  return request({
    url: '/publish/story/export',
    method: 'get',
    params: query
  })
}
